package com.onepice.mlp;

import com.onepice.mlp.utils.maker.service.GeneratorService;
import jakarta.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;


/**
 * 自动生成代码到相应路径：修改表名
 *
 * @author FireWang
 * @date 2022/1/14
 */
@ActiveProfiles("mysql")
@RunWith(SpringRunner.class)
@SpringBootTest(classes = MlpApplication.class)
public class Maker {
    @Resource
    private GeneratorService generatorService;

    @Test
    public void maker() {
        //向数组内添加表名
//        String[] tableNames = new String[]{"user", "syslog", "menu", "role", "groupd", "param"};
        String[] tableNames = new String[]{"tagdata"};

        //执行逆向工程
        generatorService.jpaMakerByTableNames(tableNames);
    }
}
